//
//  HCMineAnswerViewController.m
//  HappyChildren
//
//  Created by WillyZhao on 2017/1/18.
//  Copyright © 2017年 WillyZhao. All rights reserved.
//

#import "HCMineAnswerViewController.h"

#import "HCMineAnswerView.h"

#import "HCMineAnswerdModel.h"

@interface HCMineAnswerViewController () {
    HCMineAnswerdModel *model_answer;
    HCMineAnswerView *avl;
}

@end

@implementation HCMineAnswerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.textTitle = @"我的回答";
    
    avl = [[HCMineAnswerView alloc] initWithFrame:CGRectMake(0, 0, self.centerView.frame.size.width, self.centerView.frame.size.height)];
    [self.centerView addSubview:avl];
    
    self.dataRequest.delegate = self;
    [self.dataRequest postHC_MineAnswerdaa:HCGETUSER(@"userid")];
    
    // Do any additional setup after loading the view.
}

-(void)dataRequesterFinish:(DataRequester *)requester requesterWithType:(DataRequestType)aType receiveDictionary:(NSDictionary *)dictionary {
    NSLog(@"我的回答:%@",dictionary);
    model_answer = [[HCMineAnswerdModel alloc] initWithDictionary:dictionary error:nil];
    avl.model = model_answer;
}

-(void)dataRequesterFail:(DataRequester *)requester requesterWithType:(DataRequestType)aType receiveErrorDictionary:(NSDictionary *)dictionary {
    NSLog(@"我的回答请求失败");
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
